home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c++-part1 / 2828 < prev    next >
Encoding:
Text File  |  1996-08-06  |  2.2 KB  |  73 lines

  1. Path: user12.infohouse.com!user
  2. From: kelvin@infohouse.com (Kelvin Eng)
  3. Newsgroups: comp.lang.c++
  4. Subject: HELP WITH C PROGRAMMING
  5. Date: 19 Jan 1996 23:07:32 GMT
  6. Organization: Internet Online Services
  7. Message-ID: <kelvin-1901961812350001@user12.infohouse.com>
  8. NNTP-Posting-Host: user12.infohouse.com
  9.  
  10. I have a few C-Programming Questions that need to be answer, if you can
  11. answer or or even one, it would be of great help and would be greatly
  12. appreciated.
  13.  
  14. 1) Write a program which prompts the user for integer values for a, b, c,
  15. and d and outputs a table of values of the following polynomial: an3 + bn2
  16. + cn + d = f(n) for values of n from O to 10.
  17.  
  18. Number 2 is to be done using C-Robots
  19.  
  20. 2) Write a robot which immediately travels to the center coordinates of
  21. the screen, stays there and fires continuously in a clockwise pattern
  22. exactly 30 shots per each rotation.
  23.  
  24. 3) Write a function which accepts three arguments and evaluates the
  25. discriminant of a
  26. quadratic equation: b(squared)-4ac. The function returns 1 if the
  27. discriminant is greater than zero, -1 if less than zero and zero
  28. otherwise.
  29.  
  30. 4) Write a function which accepts 2 integer arguments and returns the sum
  31. of the squares of all the integers between those arguments (and including
  32. them.)
  33.  
  34. 5) Use a calculator, to write the output for this fragment:
  35.  
  36. main()
  37.  
  38. {
  39.                   float x = 79.1;
  40.  
  41.                   num= 1.0;
  42.  
  43.                   while(abs_val(num*num - x) > = .0000001)
  44.  
  45.                               {
  46.                                        num = (x/num + num) / 2;
  47.                                        printf(" %f\n",num);
  48.                               }
  49. }
  50.  
  51. 6) Write a function which prints out a list of Pythagorean triples in
  52. which the legs differ by 1.
  53. The function checks whether x(squared) + (x+ 1)(squared) is a perfect
  54. square as x increases from 3 to the limit of the computer:
  55.  
  56. 3           4                 5
  57.  
  58. 20          21             29
  59.  
  60. etc.
  61.  
  62. 7) Write a program containing a function called "convert" which accepts a
  63. single float
  64. argument (░F) and returns its centigrade equivalent (nearest hundredth), using: 
  65. C░ = 5 (F░-32)  / 9
  66. The program must prompt the user to enter a temperature.
  67.  
  68.  
  69.  
  70. Thanks in any help HELP
  71. Please email me at: kelvin@infohouse.com with any answers.
  72. I really appreciate it.
  73.